package com.csun.nusing.ui.activity;

import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.csun.bgaguidlib.bgaguidlib.BGABanner;
import com.csun.nusing.R;
import com.csun.nusing.presenter.GuidPresenter;
import com.csun.nusing.presenter.inter.IBase;
import com.csun.nusing.ui.BaseActivity;

/**
 * 首个Activity 可以进行判断是否需要apk升级 ClassName: GuidActivity
 * mvp架构
 * @Description: 引导页
 * @author fzq
 * @date 2017-10-18
 */
public class GuidActivity extends BaseActivity<GuidPresenter> implements IBase {


	private TextView mSkipTv;
	private Button mEnterBtn;
	private BGABanner mBackgroundBanner;
	private BGABanner mForegroundBanner;

	@Override
	public int getContentViewId() {
		return R.layout.activity_guid;
	}

	@Override
	public void initSubViews(View view) {
		super.initSubViews(view);
		// findView
		mSkipTv = findViewById(R.id.tv_guide_skip);
		mEnterBtn = findViewById(R.id.btn_guide_enter);
		mBackgroundBanner = findViewById(R.id.banner_guide_background);
		mForegroundBanner = findViewById(R.id.banner_guide_foreground);
		
	}

	
	@Override
	public void initData() {
		super.initData();
		mPresenter.controlView(this,mSkipTv,mEnterBtn,mBackgroundBanner,mForegroundBanner);
	}

	
	@Override
	protected GuidPresenter getPresenter() {
		return new GuidPresenter(this);
	}

	
	@Override
	protected void onResume() {
		super.onResume();
		// 在界面可见时给背景Banner设置一个白色背景，避免滑动过程中两个Banner都设置透明度后能看到Launcher
		mBackgroundBanner.setBackgroundResource(android.R.color.white);
	}

	
}
